-
-
Notifications
You must be signed in to change notification settings - Fork 585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create new HeidiSQL command for Windows and WSL2 #2679
Conversation
Thanks for this @andreashager ! Please do sign the CLA - it only takes a minute. |
No problem @rfay 🙂 Sorry I forgot to do this, but it should be done now 🎉 |
## Description: Run HeidiSQL against current db | ||
## Usage: heidisql | ||
## Example: "ddev heidisql" | ||
## OSTypes: linux,windows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other script commands show only if the executable is installed. Seems we ought to be able to do that here as well, except for the problem of two-environments one-machine.
"win*"* | "msys"*) | ||
# 'C:\Program Files\HeidiSQL\heidisql.exe' | ||
# You may need to add it to your system %PATH% or change the path here | ||
'C:\Program Files\HeidiSQL\heidisql.exe' "$arguments" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work if you're in git-bash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't tried it in Git-bash, i tried it in the Windows Terminal and there it worked :)
|
||
"win*"* | "msys"*) | ||
# 'C:\Program Files\HeidiSQL\heidisql.exe' | ||
# You may need to add it to your system %PATH% or change the path here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment here isn't correct is it, since pathing is not used... It probably should be used, and remove the hard-coded path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I overtook the comment from the the MySQL Workbench example ;) HeidiSQL did not write itself into the path variable, so we have to use the hard coded path here 😞
I took the liberty of extending this a bit, coming up with multiple binary locations, and a WSL2 identifier. Then I couldn't help myself and tried to tack TablePlus in there because it was all the same testing mess, going back and forth between operating systems. But I'm blocked on TablePlus/TablePlus#2224 for TablePlus. If we don't get an answer there we'll back TablePlus changes out of here. |
Per TablePlus/TablePlus-Windows#342 I guess there's no way to make TablePlus work on Windows at this point, so I'll pull out the stuff I did with TablePlus. |
Removed the TablePlus changes, rebased. |
@andreashager (and anybody else) I'd sure appreciate it if you could test this in your environment on both Windows and WSL2. The artifacts are at https://app.circleci.com/pipelines/github/drud/ddev/3291/workflows/b645feb6-c379-4ec3-bcbd-a1ed9b428d1b/jobs/29795/artifacts This is a great step forward for Windows and WSL2 users! |
@rfay How can I test this specific version of DDEV? Can I clone the repository to a specific path or do I have to overtake the changes to the specific files manually? 😕 |
Hi @andreashager you can download the artifacts at the link I gave. You'll need to get the tar for your operating system, for example ~/artifacts/ddev_macos-amd64.v1.16.2-10-ga88e3908.tar.gz for macOS. Then untar it. There's a ddev binary in there. You can put it in your path. If you use homebrew you'll want to |
Sorry for my late andere, I will test it as soon as I am Back in the Office 😊 |
I tested it today for WSL2 (Ubuntu 20.04 LTS) and for Windows 10 20H2.
How can I debug this? Do you need furhter information? |
@andreashager thanks for testing!
Thanks! |
I'm able to recreate the problem you describe using PS and cmd. It works fine in git-bash. And it also works fine in PS and cmd once the global ~/.ddev/commands/host/heidisql has been created by running ddev in git-bash. But if you delete ~/.ddev/commands/host/heidisql, it doesn't get recreated by running ddev in cmd/PS |
I had two problems testing:
|
This command runs HeidiSQL against current db.
@rfay Thanks for merging and helping to debug/test 🥳 I will try this as soon as the new release is out 🥰 Answers to your questions above (I guess you dont need it anymore 😅):
|
In 2ff4f0b, triming was added for readability of file paths but the code does not actually depend on quotes around paths. It only cares for commas to differentiate multiple paths in a given directive. Fixes: ddev#3051 This partially reverts: commit 2ff4f0b Author: Andreas Hager <3351175+andreashager@users.noreply.github.com> Date: Tue Dec 29 05:47:40 2020 +0100 Create new HeidiSQL command for Windows and WSL2 (ddev#2679)
In 2ff4f0b, triming was added for readability of file paths but the code does not actually depend on quotes around paths. It only cares for commas to differentiate multiple paths in a given directive. This partially reverts: commit 2ff4f0b Author: Andreas Hager <3351175+andreashager@users.noreply.github.com> Date: Tue Dec 29 05:47:40 2020 +0100 Create new HeidiSQL command for Windows and WSL2 (ddev#2679)
In 2ff4f0b, trimming was added for readability of file paths but the code does not actually depend on quotes around paths. It only cares for commas to differentiate multiple paths in a given directive. This partially reverts: commit 2ff4f0b Author: Andreas Hager <3351175+andreashager@users.noreply.github.com> Date: Tue Dec 29 05:47:40 2020 +0100 Create new HeidiSQL command for Windows and WSL2 (ddev#2679)
In 2ff4f0b, trimming was added for readability of file paths but the code does not actually depend on quotes around paths. It only cares for commas to differentiate multiple paths in a given directive. This partially reverts: commit 2ff4f0b Author: Andreas Hager <3351175+andreashager@users.noreply.github.com> Date: Tue Dec 29 05:47:40 2020 +0100 Create new HeidiSQL command for Windows and WSL2 (ddev#2679)
The Problem/Issue/Bug:
Create a command for Windows/WSL2 that connects with the current project database (like
ddev sequelpro
).Otherwise you always have to hardcode the database port and connect with database tool manually.
The command checks if i am on Windows directly or using DDEV with WSL2. The program used for this is HeidiSQL (https://www.heidisql.com/).
How this PR Solves The Problem:
This PR uses the Windows database tool HeidiSQL to connection to the database automatically from the command line.
Manual Testing Instructions:
Automated Testing Overview:
Related Issue Link(s):
Release/Deployment notes: